import { Navigate } from "react-router-dom";
import Login  from "../views/Login/login.js";
import Dashboard from "../views/Dashboard.js";
import Layoutadmin from "../views/admin/layout/index.js";
import Layoutstudent from "../views/student/layout/index.js";
import Layoutteacher from "../views/teacher/layout/index.js";
import Home from "../views/admin/home/index.js";
import StudentHome from "../views/student/home/index.js";
import Student from "../views/admin/student/index.js";
import Teacher from "../views/admin/teacher/index.js";
import Course from "../views/admin/course/index.js";
import AuthComponent from "../componets/authComponent.js";
import Choose from "../views/student/choose/choose.js";
import Master from "../views/student/master/master.js";
import Timetable from "../views/student/timetable/timetable.js";
import TeacherHome from "../views/teacher/home/index.js";
import Teachercourse from "../views/admin/teachercourse/index.js";
import Studentcourse from "../views/admin/studentcourse/index.js";
import Coursepage from "../views/teacher/coursepage/coursepage.js";
import CourseDetailPage from "../views/teacher/coursepage/course.js";
import Coursepagestu from "../views/student/coursepage/coursepage.js";
import CourseDetailPagestu from "../views/student/coursepage/course.js";
import Coursetimetable from "../views/student/timetable/course.js";
import TeacherTimetable from "../views/teacher/timetable/timetable.js";
import Courseteachertimetable from "../views/teacher/timetable/course.js";
import Homework from "../views/teacher/homework/homework.js";
import DohomeworkList from "../views/student/coursepage/dowork.js";
import CorrectionPage from "../views/teacher/homework/correct.js";
const routes = [
    { path: "/login", element: <Login /> },
    { path: "/Layoutadmin", element: <AuthComponent><Layoutadmin /></AuthComponent>,
    children:[
        { path:'/Layoutadmin/home',element:<Home/> },
        { path:'/Layoutadmin/student',element:<Student/> },
        { path:'/Layoutadmin/teacher',element:<Teacher/> },
        { path:'/Layoutadmin/course',element:<Course/> },
        { path:'/Layoutadmin/teachercourse',element:<Teachercourse/> },
        { path:'/Layoutadmin/studentcourse',element:<Studentcourse/> }
      ] 
    },
    { path: "/Layoutstudent", element: <AuthComponent><Layoutstudent /></AuthComponent>,
    children:[
      { path:'/Layoutstudent/home',element:<StudentHome/> },
      { path:'/Layoutstudent/choose',element:<Choose/> },
      { path:'/Layoutstudent/master',element:<Master/> },
      { path:'/Layoutstudent/timetable',element:<Timetable/> },
      { path:'/Layoutstudent/coursepage',element:<Coursepagestu/> },
      { path:'/Layoutstudent/course/:id', element:<CourseDetailPagestu/> },
      { path:'/Layoutstudent/coursetimetable/:id', element:<Coursetimetable/> },
      { path:'/Layoutstudent/correct/:courseid/:homeworkid', element:<DohomeworkList/> },

    ] 
  },
    { path: "/Layoutteacher", element: <AuthComponent><Layoutteacher /></AuthComponent>,
    children:[
      { path:'/Layoutteacher/home',element:<TeacherHome/> },
      { path:'/Layoutteacher/choose',element:<Choose/> },
      { path:'/Layoutteacher/coursepage',element:<Coursepage/> },
      { path:'/Layoutteacher/course/:id', element:<CourseDetailPage/> },
      { path:'/Layoutteacher/timetable', element:<TeacherTimetable/> },
      { path:'/Layoutteacher/courseteachertimetable/:id', element:<Courseteachertimetable/> },
      { path:'/Layoutteacher/homework/:id', element:<Homework/> },
      { path:'/Layoutteacher/correct/:courseid/:homeworkid', element:<CorrectionPage/> },
    ] 
  },
    { path: "", element: <Navigate to="/login" /> }
];
export default routes

